from launch import LaunchDescription
from launch_ros.actions import Node
from ament_index_python.packages import get_package_share_directory

def generate_launch_description():
    return LaunchDescription([
        # 启动ArUco识别节点
        Node(
            package='aruco_ros',
            executable='single',
            parameters=[
                {'image_is_rectified': True},
                {'marker_size': 0.1},  # 标记实际大小（米）
                {'marker_id': 26},     # 要识别的标记ID
                {'reference_frame': 'camera_link'},
                {'camera_frame': 'camera_color_optical_frame'},
                {'marker_frame': 'aruco_marker'}
            ],
            remappings=[
                ('/image', '/camera/color/image_raw'),
                ('/camera_info', '/camera/color/camera_info')
            ]
        ),

        # 启动跟随控制节点
        Node(
            package='go2_aruco_follower',
            executable='follower.py',
            output='screen'
        )
    ])